#pragma once

namespace mgui
{
	struct Point
	{
		Point() { X = 0; Y = 0; }
		Point(uint x, uint y) { X = x; Y = y; }
		uint X, Y;
	};

	struct Rect
	{
		Rect(uint x, uint y, uint width, uint height)
		{
			X = x;
			Y = y;
			Width = width;
			Height = height;
		}
		uint X, Y, Width, Height;
	};

	bool pointInRect(const Point & p, const Rect & rect);

	struct KeyEvent
	{
		enum Key
		{
			KEY_SPACE,
			KEY_ENTER,
			KEY_BACKSPACE,
			KEY_SHIFT,
			KEY_ESCAPE,
			KEY_TAB,
			KEY_CR,
			KEY_LEFT,
			KEY_RIGHT,
			KEY_UP,
			KEY_DOWN,
			KEY_CHAR,
			KEY_UNKOWN
		};

		Key PressedKey;
		TCHAR Char;
	};

	KeyEvent convert_WM_CHAR_ToKeyEvent(WPARAM wParam, LPARAM lParam);
	KeyEvent convert_WM_KEYDOWN_ToKeyEvent(WPARAM wParam, LPARAM lParam);
}